package sy.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

/**
 * TuserTvehicle entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "tsupplier_tvehicle", schema = "")
@DynamicUpdate(true)
@DynamicInsert(true)
public class TsupplierTvehicle implements java.io.Serializable {

	// Fields

	private String id;
	private TsupplierInfo tsupplier;
	private TvehicleInfo tvehicle;

	// Constructors

	/** default constructor */
	public TsupplierTvehicle() {
	}

	/** full constructor */
	public TsupplierTvehicle(String id, TsupplierInfo tsupplier, TvehicleInfo tvehicle) {
		this.id = id;
		this.tsupplier = tsupplier;
		this.tvehicle = tvehicle;
	}

	// Property accessors
	@Id
	@Column(name = "ID", nullable = false, length = 36)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "supplier_id", nullable = false)
	public TsupplierInfo getTsupplier() {
		return this.tsupplier;
	}

	public void setTsupplier(TsupplierInfo tsupplier) {
		this.tsupplier = tsupplier;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "vehicle_id", nullable = false)
	public TvehicleInfo getTvehicle() {
		return this.tvehicle;
	}

	public void setTvehicle(TvehicleInfo tvehicle) {
		this.tvehicle = tvehicle;
	}

}